home *** CD-ROM | disk | FTP | other *** search
- /*
- ssgHFSlib: Copyright © 1987 by small systems guild
-
- All rights reserved
-
- small systems guild
- PO box 2751
- Ann Arbor, MI 48106
- (313) 996-4238
-
- File: ssgHFSlib.h
- Module: dir search
- Includes:
- Model: LightSpeed C 2.11, Aztec C 1.06i
- Target: Macintosh Operating System
-
- Edit history ($Log$):
- 11/16/87 ebs check for currently open files. Backup dates
- 11/03/87 DAF added file comments field
- 10/26/87 ebs added colormap
- 10/12/87 ebs changed structures a bit
- 10/9/87 ebs added fields to structures
- 10/8/87 ebs created from existing HFS libraries
-
- */
-
-
-
- /* file open attributes */
- #define HFS_LOCKED 0
- #define HFS_RES_OPEN 0x4
- #define HFS_DATA_OPEN 0x8
- #define HFS_DIR 0x10
- #define HFS_OPEN 0x80
-
-
- /* This structure contains fields unique to directories */
- typedef struct
- {
- int dir_id; /* Mac directory ID number */
- int parent;
- #ifdef CANT_HAVE_THIS
- unsigned int num_files; /* number of immediate subfiles */
- unsigned int num_folders; /* number of immediate subfolders */
- unsigned int num_appls; /* number of imm executables (for display) */
- unsigned int tot_num_files; /* number files in entire subtree */
- unsigned int tot_num_folders; /* number folders in entire subtree */
- unsigned long tot_data_size; /* data fork size for entire subtree */
- unsigned long tot_res_size; /* res fork size for entire subtree */
- unsigned int depth; /* How many levels deep are we? */
- /*struct FOLDER_INFO *parent;*/ /* Pointer to parent node */
- #else
- unsigned int valence; /* num files + folders in dir */
- #endif
- } DIR_ONLY;
-
-
- /* this structure contains fields unique to files */
- typedef struct
- {
- unsigned long type;
- unsigned long creator;
- int icon_num;
- int path_ref; /* Path if file is open */
- unsigned char cur_attr; /* Open attributes */
- } FILE_ONLY;
-
- typedef struct
- {
- int target_dir; /* dirID to restore to */
- int target_vol;
- unsigned long create_time;
- unsigned long mod_time;
- unsigned long type;
- unsigned long creator;
- unsigned is_dir:1; /* NOTE: 1=DIRECTORY NODE 0=QUALIFIER NODE */
- unsigned match_all:1; /* if is_dir=0, this bit is same as a *.* node */
- unsigned search_subs:1;
- unsigned keep_tree:1;
- unsigned time_rel:3;
- unsigned use_create:1; /* true = create time, else mod */
- unsigned name_cmp:2; /* starts, ends, contains, equals */
- unsigned select_rule:1; /* a select rule? (else an unselect rule!) */
- } MAC_QDATA;
-
- /* this structure is the combination of everything we need */
- typedef struct
- {
- unsigned char name[50];
- unsigned long data_size, res_size;
- unsigned long create_time, mod_time, bak_time;
- int file_cmnt;
- unsigned icon_color:3;
- unsigned select_state:2;
- unsigned is_dir:1; /* 1=directory 0=file */
- unsigned is_vol:1;
- unsigned is_tape:1;
- union
- {
- FILE_ONLY file;
- DIR_ONLY dir;
- }info;
- #ifdef NEEDED
- /* Qal info */
- int target_dir; /* dirID to restore to */
- int target_vol;
- unsigned search_subs:1;
- unsigned keep_tree:1;
- unsigned time_rel:3;
- unsigned name_cmp:2; /* starts, ends, contains, equals */
- #endif
- } FILE_INFO;
-
- typedef struct
- {
- unsigned char name[50]; /* Pascal name */
- int refnum;
- unsigned long size;
- unsigned is_hfs:1;
- unsigned is_mfs:1;
- unsigned is_floppy:1;
- } VOL_INFO;
-
- typedef struct
- {
- int num_vols;
- VOL_INFO vol[10];
- } ALL_VOLS;
-
- typedef struct
- {
- int iconID; /* icon resource ID */
- int refNum; /* volume reference number */
- unsigned char name[50]; /* Pascal string vol name */
- } VolCell;
-
-